 <link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/reset.css">
<link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/index.css">
<link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/main.css">
<link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/jquery.fancybox.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/jquery.fancybox-buttons.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{$modules_dir}/smartblog/css/jquery.fancybox-thumbs.css" rel="stylesheet">
<script type="text/javascript" src="{$modules_dir}/smartblog/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="{$modules_dir}/smartblog/js/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="{$modules_dir}/smartblog/js/jquery.fancybox-buttons.js"></script>
<script type="text/javascript" src="{$modules_dir}/smartblog/js/jquery.fancybox-thumbs.js"></script>
<script type="text/javascript" src="{$modules_dir}/smartblog/js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="{$modules_dir}/smartblog/js/beggindex.js"></script>
 
 <!--面包屑-->
{capture name=path}<a href="{smartblog::GetSmartBlogLink('smartblog')}">{l s='All Blog News' mod='smartblog'}</a><span class="navigation-pipe">{$navigationPipe}</span>{$meta_title}{/capture}

  
  <div class="blog">
        <div class="blog-top">
		   <!--blog标题-->
           <h1>{$meta_title}</h1>
		   <!--blog作者，时间，栏目，评论条数-->
		    {assign var="catOptions" value=null}
                        {$catOptions.id_category = $id_category}
                        {$catOptions.slug = $cat_link_rewrite}
           <h3>{if $smartshowauthorstyle != 0}{$firstname} {$lastname}{else}{$lastname} {$firstname}{/if}</h3>
           <h5>{$created|date_format:"%Y-%m-%d"}</h5>
        </div>
        <div class="blog-info">
		   <!--blog缩略图-->
		    {assign var="activeimgincat" value='0'}
                    {$activeimgincat = $smartshownoimg} 
		    {if ($post_img != "no" && $activeimgincat == 0) || $activeimgincat == 1}
                        <img src="{$modules_dir}/smartblog/images/{$post_img}-single-default.jpg" style="display: block;margin:0 auto" alt="{$meta_title}">
            {/if}
           <br>
		   <!--blog详细内容-->
           <p>{$content}</p>
	   </div>
        <div class="share" style="display:none;">
           Share:
           <a href=""><img src="images/facebook.png" height="32" width="32"></a>
           <a href=""><img src="images/twitter.png" height="32" width="32"></a>
           <a href=""><img src="images/pinterest.png" height="32" width="32"></a>
           <a href=""><img src="images/google+.png" height="32" width="32"></a>
         </div>
        
        <!-- leave-comment form-->
		
		{if Configuration::get('smartenablecomment') == 1}
		{if $comment_status == 1}
			<div class="leave-comment">
				<h1>{l s="Leave a Comment"  mod="smartblog"}</h1>
				<div id="commentInput">
					<form action="" method="post" id="commentform">
						<div>  
						   <input type="text" tabindex="1" name="name" placeholder="{l s='Name:'  mod='smartblog'}">						 
						   <input type="text" tabindex="2" value="" name="mail" placeholder="{l s='E-mail:'  mod='smartblog'}">
						</div>
						<div>
						   <textarea tabindex="4" name="comment" placeholder="{l s='Comment:'  mod='smartblog'}"></textarea>
						</div>
						<!--验证码-->
	                    {if Configuration::get('smartcaptchaoption') == '1'}
							<div>
							    <img src="{$modules_dir}smartblog/classes/CaptchaSecurityImages.php?width=100&height=40&characters=5">
                                <input type="text" tabindex="" placeholder="{l s='Type Code' mod='smartblog'}" name="smartblogcaptcha" > 							   
							</div>
						{/if}
						<div>
						   <!--隐藏域-->
						   <input type='hidden' name='comment_post_ID' value='1478' id='comment_post_ID' />
						   <input type='hidden' name='id_post' value='{$id_post}' id='id_post' />
						   <input type='hidden' name='comment_parent' id='comment_parent' value='0' />
						   
						   <input type="submit" class="submit" value="SUBMIT COMMENT" name="addComment" id="submitComment">
						   
						</div>
					</form>
				</div>
			</div>
		{/if}
		{/if}
        <!-- leave-comment form-->	
		<!--评论内容-->
		{if $countcomment != ''}
			<div class="blog-comment">
				<h1>Comments</h1>
				<ul class="blog-comment-list">
				    {$i=1}
					{foreach from=$comments item=comment}
						
						   {include file="./comment_loop.tpl" childcommnets=$comment}
					   
					{/foreach}
				</ul>
			</div>		
			<!-- blog-comment -->
			
			<!--page  -->
				<!--分页-->
				{if !empty($pagenums)}
				<div class="row">
				<div class="post-page col-md-12">
						<div class="col-md-6">
							<ul class="pagination">
								{for $k=0 to $pagenums}
									{if $title_category != ''}
										{assign var="options" value=null}
										{$options.page = $k+1}
										{$options.id_category = $id_category}
										{$options.slug = $cat_link_rewrite}
									{else}
										{assign var="options" value=null}
										{$options.page = $k+1}
									{/if}
									{if ($k+1) == $c}
										<li><span class="page-active">{$k+1}</span></li>
									{else}
											{if $title_category != ''}
												<li><a class="page-link" href="{smartblog::GetSmartBlogLink('smartblog_category_pagination',$options)}">{$k+1}</a></li>
											{else}
												<li><a class="page-link" href="{smartblog::GetSmartBlogLink('smartblog_list_pagination',$options)}">{$k+1}</a></li>
											{/if}
									{/if}
							   {/for}
							</ul>
						</div>
						<div class="col-md-6">
							<div class="results">{l s="Showing" mod="smartblog"} {if $limit_start!=0}{$limit_start}{else}1{/if} {l s="to" mod="smartlatestnews"} {if $limit_start+$limit >= $total}{$total}{else}{$limit_start+$limit}{/if} {l s="of" mod="smartblog"} {$total} ({$c} {l s="Pages" mod="smartblog"})</div>
						</div>
				</div>
				</div> 
			  
			   {/if}
				<!-- page end -->
			
			
			
			
			
			
			
	    {/if}
  </div>
  <!-- 回到顶部 -->
<div id="back-to-top"></div>
<!-- 回到顶部 end-->
  
{if Configuration::get('smartenablecomment') == 1}
{if $comment_status == 1}  
<script type="text/javascript">
	//提交评论
	$('#submitComment').bind('click',function(event) {
	event.preventDefault();
	var data = { 'action':'postcomment', 
	'id_post':$('input[name=\'id_post\']').val(),
	'comment_parent':$('input[name=\'comment_parent\']').val(),
	'name':$('input[name=\'name\']').val(),
	'website':$('input[name=\'website\']').val(),
	'smartblogcaptcha':$('input[name=\'smartblogcaptcha\']').val(),
	'comment':$('textarea[name=\'comment\']').val(),
	'mail':$('input[name=\'mail\']').val() };
		$.ajax( {
		  url: baseDir + 'modules/smartblog/ajax.php',
		  data: data,
		  
		  dataType: 'json',
		  
		  beforeSend: function() {
					$('.success, .warning, .error').remove();
					$('#submitComment').attr('disabled', true);
					$('#commentInput').before('<div class="attention"><img src="http://321cart.com/sellya/catalog/view/theme/default/image/loading.gif" alt="" />Please wait!</div>');

					},
					complete: function() {
					$('#submitComment').attr('disabled', false);
					$('.attention').remove();
					},
			success: function(json) {
				if (json['error']) {
						 
							$('#commentInput').before('<div class="warning">' + '<i class="icon-warning-sign icon-lg"></i>' + json['error']['common'] + '</div>');
							
							if (json['error']['name']) {
								$('.inputName').after('<span class="error">' + json['error']['name'] + '</span>');
							}
							if (json['error']['mail']) {
								$('.inputMail').after('<span class="error">' + json['error']['mail'] + '</span>');
							}
							if (json['error']['comment']) {
								$('.inputContent').after('<span class="error">' + json['error']['comment'] + '</span>');
							}
							if (json['error']['captcha']) {
								$('.smartblogcaptcha').after('<span class="error">' + json['error']['captcha'] + '</span>');
							}
						}
						
						if (json['success']) {
							$('input[name=\'name\']').val('');
							$('input[name=\'mail\']').val('');
							$('input[name=\'website\']').val('');
							$('textarea[name=\'comment\']').val('');
							$('input[name=\'smartblogcaptcha\']').val('');
						
							$('#commentInput').before('<div class="success">' + json['success'] + '</div>');
							setTimeout(function(){
								$('.success').fadeOut(300).delay(450).remove();
														},2500);
						
						}
					}
				} );
			} );
</script>
{/if}
{/if}
